<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>坦克大战 3D</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            overflow: hidden;
            font-family: 'Arial', sans-serif;
        }

        #loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #222;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            transition: opacity 0.5s;
        }

        #loading h1 {
            color: #fff;
            margin-bottom: 20px;
            font-size: 36px;
        }

        #progress-container {
            width: 80%;
            max-width: 500px;
            height: 30px;
            background-color: #444;
            border-radius: 15px;
            overflow: hidden;
        }

        #progress-bar {
            width: 0%;
            height: 100%;
            background-color: #4CAF50;
            transition: width 0.3s;
        }

        #start-button {
            display: none;
            margin-top: 30px;
            padding: 15px 40px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 20px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        #start-button:hover {
            background-color: #45a049;
        }

        #loading-text {
            margin-top: 20px;
            color: #aaa;
        }

        #game-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        #hud {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 100;
            color: white;
            text-shadow: 1px 1px 2px black;
            font-size: 24px;
            pointer-events: none;
        }

        #score,
        #health {
            margin: 10px 0;
            background-color: rgba(0, 0, 0, 0.5);
            padding: 5px 15px;
            border-radius: 10px;
        }

        #health-bar {
            width: 100%;
            height: 20px;
            background-color: #444;
            border-radius: 10px;
            overflow: hidden;
        }

        #health-fill {
            height: 100%;
            background-color: #4CAF50;
            transition: width 0.3s;
        }

        #game-over {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 500;
        }

        #game-over h2 {
            color: #fff;
            font-size: 48px;
            margin-bottom: 20px;
        }

        #final-score {
            color: #fff;
            font-size: 36px;
            margin-bottom: 30px;
        }

        #restart-button {
            padding: 15px 40px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 20px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        #restart-button:hover {
            background-color: #45a049;
        }

        #debug-info {
            position: fixed;
            bottom: 10px;
            right: 10px;
            color: white;
            background-color: rgba(0, 0, 0, 0.5);
            padding: 5px;
            border-radius: 5px;
            font-size: 12px;
            font-family: monospace;
            z-index: 999;
        }

        #performance-stats {
            position: fixed;
            top: 20px;
            right: 20px;
            color: white;
            background-color: rgba(0, 0, 0, 0.5);
            padding: 5px;
            border-radius: 5px;
            font-size: 12px;
            font-family: monospace;
            z-index: 999;
        }
    </style>
</head>

<body>
    <!-- 加载界面 -->
    <div id="loading">
        <h1>坦克大战 3D</h1>
        <div id="progress-container">
            <div id="progress-bar"></div>
        </div>
        <div id="loading-text">正在加载游戏资源...</div>
        <button id="start-button">开始游戏</button>
    </div>

    <!-- 游戏容器 -->
    <div id="game-container"></div>

    <!-- HUD -->
    <div id="hud">
        <div id="score">分数: 0</div>
        <div id="health">
            生命值: 100
            <div id="health-bar">
                <div id="health-fill"></div>
            </div>
        </div>
    </div>

    <!-- 游戏结束界面 -->
    <div id="game-over">
        <h2>游戏结束</h2>
        <div id="final-score">最终分数: 0</div>
        <button id="restart-button">重新开始</button>
    </div>

    <!-- 调试信息 -->
    <div id="debug-info"></div>

    <!-- 性能监视器容器 -->
    <div id="performance-stats"></div>

    <!-- 游戏脚本 -->
    <script type="module" src="/src/main.ts"></script>
</body>

</html>